package com.ABdolphin.forum.controller;

import com.ABdolphin.forum.exception.ApplicationException;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/test")
@RestController
@Tag(name = "test")
public class TestController {
    @Operation(description = "测试")
    @GetMapping("/t1")
    public void test1(@Parameter(name = "a") String a){
        throw new ApplicationException("测试ApplicationException");
    }
    @GetMapping("/t2")
    public void test2(){
        try {
            int a=1/0;
        }catch (Exception e){
            throw e;
        }

    }
}
